import { useState } from 'react'
import st from './tabs.module.css'
const CommonTabs = (prop: any) => {
    const { config } = prop
    const [act, setAct] = useState(0)
    return <div className={st.tabsBox}>
        {config.map((item: any) => <div 
        className={`${st.TabItem} ${act === item.id ? st.actItem : ''}`} 
        key={item.id}
        onClick={()=>setAct(item.id)}
        >{item.text}</div>)}

    </div>
}

export default CommonTabs